// index.js
// 自定义tabBar
Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#31869B",
    fontWeight: 'bold',
    "list": [
      {
        "pagePath": "/pages/index/index",
        "text": "笑谈",
        "iconPath": "/static/image/icon/joke.png",
        "selectedIconPath": "/static/image/icon/joke_on.png"
      },
      {
        "pagePath": "/pages/index/image",
        "text": "趣图",
        "iconPath": "/static/image/icon/funny.png",
        "selectedIconPath": "/static/image/icon/funny_on.png"
      }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      console.log(data)
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})
